//
//  StarRateView.h
//  ImGuider
//
//  Created by llt on 2017/4/18.
//  Copyright © 2017年 imguider. All rights reserved.
//

#import <UIKit/UIKit.h>

#define kFOREGROUND_STAR @"star"
#define kBACKGROUND_STAR @"unstar"
#define kNUMBER_OF_STAR 5

@protocol StarRateViewDelegate;

@interface StarRateView : UIView

@property (nonatomic) BOOL canRating;

@property (nonatomic, weak) id <StarRateViewDelegate> delegate;

/**
 *  Init TQStarRatingView
 *
 *  @param frame  Rectangles
 *  @param number 星星个数
 *
 *  @return TQStarRatingViewObject
 */
- (id)initWithFrame:(CGRect)frame numberOfStars:(int)number;

/**
 *  设置控件分数
 *
 *  @param score     分数，必须在 1-numberOfStar 之间
 *  @param isAnimate 是否启用动画
 */
- (void)setScore:(float)score withAnimation:(bool)isAnimate;

- (void)setScore:(float)score;

@end

@protocol StarRateViewDelegate <NSObject>

@optional
-(void)starRatingView:(StarRateView *)view score:(float)score;

@end
